#ifndef __INCLUDED_AMXX_HELPERS_H
#define __INCLUDED_AMXX_HELPERS_H

#include "amxxmodule.h"

inline void SetFlag32(int & value, int flag, bool enabled)
{
	if(enabled)
		value |= flag;
	else value &= ~flag;
}

int RegisterSPForwardByProto(AMX *amx, const char *fname, const int *proto_args);

class t_SubscribeEvent_Helper
{
protected:
	AMX *m_AMX;
	const char *m_EventName;
	int m_FunctionID;
	bool m_NameMatched;

public:
	t_SubscribeEvent_Helper(AMX *amx, const char *event_name);
	void Examine(const char *pending_event_name, const int *pending_proto_args, int &pending_callback);
	bool NameMatched() {return m_NameMatched;}
	bool FunctionRegistered() {return m_FunctionID > 0;}
};

#endif // __INCLUDED_AMXX_HELPERS_H